<template>
  <view>
    <button @click="login">登录</button>
  </view>
</template>

<script setup>
import { Login } from "../../api";
import { useTokenStore } from "../../stores/token";
const { setToken,token } = useTokenStore();
function login() {
  Login({
    mobile: 18253965759,
    sms_code: 1110,
  }).then((res) => {
    // console.log(res)
    // uni.setStorage({
    //   key:'token',
    //   data:res.data.token
    // });
    token.value = res.data.token;
    setToken(res.data.token);
  });
}
</script>

<style>
</style>
